package com.user.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.user.entity.AdminMenu;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

public interface AdminMenuMapper extends BaseMapper<AdminMenu> {
    //获取用户权限
    @Select("select am.* from wk_admin_menu am \n" +
            "LEFT JOIN wk_admin_role_menu rm on am.menu_id = rm.menu_id\n" +
            "LEFT JOIN wk_admin_user_role ur on ur.role_id = rm.role_id\n" +
            "LEFT JOIN wk_admin_role ar on ar.role_id = ur.role_id\n" +
            "where ur.user_id = #{userid}")
    public List<AdminMenu> getAdminMenuItems(Integer userid);
}
